#!/bin/sh
#
# 简单写一下脚本的功能。
#
#
#

if [ $# -ne 0 ]; then
	echo "Usage: this is a empty shell."
	exit
fi

workdir=~/workshop/gitee/3place/

cd $workdir

for dirs in ` ls -l |grep ^d |sed -e "/EN$/d" |awk '{print $NF}'`
do

	cd $dirs

	if [ ! -e config ]; then
		cd ..
		continue
	fi

	source config

	mdfile=$bookname"_"$tag.md

	if [ -e ../../readed/$mdfile ];then
		t_date=`find . -mnewer ../../readed/$mdfile |grep $tag$files`
		if [ $? -eq 0 ]; then 
			tarbook
		fi
	else
		tarbook
	fi

	if [ -e $mdfile ]; then
		mv $mdfile ../../readed/
	fi
	cd ..
done

